#include "baseApp.h"

void baseApp::setup() {
	rb_funcall(obj, id_setup, 0);
}

void baseApp::update() {
	rb_funcall(obj, id_update, 0);
}

void baseApp::draw() {
	rb_funcall(obj, id_draw, 0);
}

void baseApp::exit() {
	rb_funcall(obj, id_exit, 0);
}

void baseApp::keyPressed(int key) { 
	rb_funcall(obj, id_keyPressed, 1, INT2FIX(key));
}

void baseApp::keyReleased(int key) { 
	rb_funcall(obj, id_keyReleased, 1, INT2FIX(key));
}

void baseApp::mouseMoved(int x, int y ) {
	rb_funcall(obj, id_mouseMoved, 2, INT2FIX(x), INT2FIX(y));
}

void baseApp::mouseDragged(int x, int y, int button) {
	rb_funcall(obj, id_mouseDragged, 3, INT2FIX(x), INT2FIX(y), INT2FIX(button));
}

void baseApp::mousePressed(int x, int y, int button) {
	rb_funcall(obj, id_mousePressed, 3, INT2FIX(x), INT2FIX(y), INT2FIX(button));
}

void baseApp::mouseReleased() {
	rb_funcall(obj, id_mouseReleased, 0);
}
